package com.molichuxing.gateway.api.services;

import java.util.List;
import java.util.Map;

import com.molichuxing.gateway.bff.goods.entity.response.*;
import org.springframework.validation.BindingResult;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.bff.goods.entity.request.create.GoodsExclusiveCreateVo;
import com.molichuxing.gateway.bff.goods.entity.request.create.GoodsSubscribeCreateVo;

/**
 * 商品信息web接口
 * @author xuelin yi
 */
public interface GoodsApiService {

    /**
     * 获取商品信息列表
     * @param selectParams
     * @return
     */
    public ResponseResult<Paged<GoodsVo>> getGoodsList(Map<String, Object> selectParams);

    /**
     * 获取商品基础信息
     * @param goodsId
     * @return
     */
    public ResponseResult<GoodsBaseVo> getBaseGoods(Integer goodsId);

    /**
     * 获取商品详细信息
     * @param goodsId
     * @return
     */
    public ResponseResult<GoodsDetailVo> getDetailGoods(Integer goodsId);

    /**
     * 新增专属商品信息列表
     * @param createDtoList
     * @return
     * @throws Exception
     */
	public ResponseResult<Boolean> createExclusiveGoods(List<GoodsExclusiveCreateVo> createDtoList, BindingResult bindingResult)
			throws Exception;

    /**
     * 新增订阅商品信息列表
     * @param createDtoList
     * @return
     * @throws Exception
     */
    public ResponseResult<Boolean> createSubscribeGoods(List<GoodsSubscribeCreateVo> createDtoList) throws Exception;

    /**
     * 设置商品禁售状态
     * @param goodsId
     * @param isForbidSale
     * @return
     * @throws Exception
     */
    public ResponseResult<Boolean> settingGoodsSale(int goodsId, Byte isForbidSale) throws Exception;

    /**
     * 根据规格的key和商品类型查询规格信息
     * @param specList
     * @param goodsType
     * @return
     * @throws Exception
     */
    public ResponseResult<List<GoodsSpecConfigVo>> getGoodsProductSpecList(List<String> specList, int goodsType) throws Exception;

    /**
     * 根据商品ID获取未授权和已授权的经销商
     * @param goodsId
     * @param dealerName
     * @param cityId
     * @param status
     * @param pageNum
     * @param pageSize
     * @return
     */
    public ResponseResult<Paged<GoodsDealerVo>> getDealerPage(Integer goodsId, String dealerName, Integer cityId, Integer status, int pageNum, int pageSize);

    /**
     * 根据商品ID获取未授权和已授权的经销商
     * @param goodsId
     * @param areaId
     * @param areaType
     * @param status
     * @return
     */
    public ResponseResult<List<GoodsDealerVo>> getDealerList(Integer goodsId, Integer areaId, Integer areaType, Integer status);

    /**
     * 设置商品和经销商的分销状态
     * @param goods
     * @param dealerId
     * @param status
     * @return
     */
    public ResponseResult<Boolean> settingGoodsDistribution(Integer goods, Integer dealerId, Integer status);

    /**
     * 授权商品和分销商的关系
     * @param goodsId
     * @param dealerIds
     * @return
     * @throws Exception
     */
    public ResponseResult<Boolean> createGoodsDealer(Integer goodsId, List<Integer> dealerIds) throws Exception;

    /**
     * 根据业务类型查询合同信息
     * @param businessType
     * @return
     */
    public ResponseResult<Paged<ContractTemplateVo>> getContractTemplateList(Integer businessType);

}
